<extend name="Base/common"/>
<block name="style">
    <link  rel="stylesheet"  href="__PUBLIC__/Wap/css/member.css">
</block>

<block name="content">

    <div  id="loadingPicBlock">
        <div  class="wrapper">
            <div  class="m_buylist_nav"  id="navBox">
                <p>
                    <a  href="javascript:" id="recordid" class="hover">我的出价纪录<em></em></a>
                    <!-- <a  href="javascript:recording();" id="recordingid" class="">进行中<em></em></a>
                    <a  href="javascript:recordf();" id="recordfid" class="">已完成<em></em></a> -->
                </p>
            </div>
            <div  id="divBuyList"  class="m_buylist">
               <notempty name="user_list">
                <ul style="display: block;">
                   <volist name="user_list" id="vo">
                        <?php
                         $bid=M('bid_list')->where(array('id'=>$vo['bid_id']))->find();
                         $bid_good=M('bid_good')->where(array('id'=>$vo['good_id']))->find();
                         $good_info=M('goods')->where(array('id'=>$bid_good['good_id']))->find();
                         $good_info['good_img_arr']=explode(',',$good_info['good_img']);
                         $user_list=M('bid_user')->where(array('bid_id'=>$vo['bid_id'],'good_id'=>$vo['good_id']))->order('per_price desc,create_time asc')->select();
                        ?>
                    <li>
                        <cite>
                          <a  href="{:U('Index/details', array('id' => $vo['good_id']))}">
                            <img  src="__ROOT__{$good_info['good_img_arr'][0]}">
                          </a>
                            <i><if condition="$bid['end_time'] lt time()">已结束<else/>进行中</if></i>
                        </cite>
                        <dl>
                            <dt>
                                <a  href="{:U('Index/details', array('id' => $vo['good_id']))}}"  class="gray6">{$good_info['goods_name']}</a>
                            </dt>
                            <dd>
                                <if condition="$bid['end_time'] lt time()">
                                    获得者：
                                    <a  href="javascript:"  class="blue">
                                        <?php
                                          $user=M('agent')->where(array('uid'=>$user_list[0]['user_id']))->field('username')->find();
                                          echo $user['username'];
                                        ?>
                                    </a>

                                 <else/>
                                    预计竞得者：
                                    <a  href="javascript:"  class="blue">
                                         <?php
                                            $user=M('agent')->where(array('uid'=>$user_list[0]['user_id']))->field('username')->find();
                                            echo $user['username'];
                                        ?>
                                    </a>
                                </if>

                            </dd>
                            <dd>开始时间：<em>{:date('Y-m-d H:i:s',$bid['start_time'])}</em></dd>
                            <dd>结束时间：<em>{:date('Y-m-d H:i:s',$bid['end_time'])}</em></dd>
                        </dl>
                    </li>
                   </volist>
                </ul>
              <else/>
                 <div class="noRecords gray9"><s></s>暂无记录</div>
               </notempty>
               <div  id="divGoodsLoading"  class="loading"  style="display: none;"><b></b>正在加载</div>
            </div>
            <div  class="load_more"  id="btnLoadMore"  style="display: block;"><a  href="{php echo $this->createMobileUrl('redetails', array('sid' => $goods['id']))}"  title="加载更多"></a></div>

        </div>
    </div>

</block>

<block name="footer">
    <div class="footer" style="bottom: 0px;">
        <ul>
            <li class="f_home"><a href="{:U('Index/index')}" title="首页"><i class="icon iconfont">&#xe61c;</i>首页</a></li>
            <li class="f_whole"><a href="{:U('Public/introduction')}" title="竞价介绍"><i class="icon iconfont">&#xe627;</i>竞价介绍</a></li>
            <li class="f_personal"><a href="{:U('Agent/profile')}" class="hover" title="个人中心"><i class="icon iconfont">&#xe61e;</i>个人中心</a></li>
        </ul>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        function setOrderStatus(self){
            var url=self.attr('data-url')
            $.get(url, function(data){
                if(data.status==1){
                    alert(data.info);
                    window.location.reload();
                }else{
                    alert(data.info);
                }
            });
        }
    </script>
</block>
